<?php
/**
 * Created by JetBrains PhpStorm.
 * User: amjadsyed
 * Date: 23/03/13
 * Time: 1:02 AM
 * To change this template use File | Settings | File Templates.
 */


require_once ('SolrPhpClient/Apache/Solr/Service.php');


$solr = new Apache_Solr_Service('localhost', '8080', '/solr');

$query = $_POST['srch'];

$response = $solr->search($query);

$jsonstr = $response->getRawResponse();
$obj = json_decode($jsonstr, true);

foreach ($obj['response']['docs'] as $item) {
    echo "Doctor Name: " . "<b>".$item['memName'] ."</b>". "<BR />" . "Specialization: " ."<b>".$item['specName'] ."</b>" . "<BR />" . "Address: " ."<b>".$item['addrLine1'].", " . $item['addrLine2'].", " . $item['addrStreet'] .", ". $item['addrCity'] .", ". $item['stateName'] ."</b>"." - ". $item['zipcode']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "<a href='#' ><button>Book Appointment</button></a>";
    echo'<hr />';
}

